<template>
	<view class="main">
	
		<block>
			<view class="active_tit">
				<view class="tit">
					财务报表--资产负债表
				</view> 
			</view>
			<view class="active_tit">
				<view class="tit">
					资产
				</view> 
			</view>
			<!-- input -->
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					现金、银行存款：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030101.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					应收账款（元）：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030102.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					预付账款：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030103.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					存货：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030104.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					固定资产：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030105.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					经营性房地产：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030106.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					机器设备：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030107.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					经营性车辆：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030108.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					其他经营性资产：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030109.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					资产总计：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="zichan" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					表外资产（如有）：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030110.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			
			<view class="active_tit">
				<view class="tit2">
					负债
				</view> 
			</view>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					银行借款：
				</view>
				<view class="active_input">
					<mInput disabled type="number" v-model="form.A03.A030201.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					其他负债业务（小贷公司等其他非银金融机构）：
				</view>
				<view class="active_input">
					<mInput type="number" disabled v-model="form.A03.A030202.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					信用卡：
				</view>
				<view class="active_input">
					<mInput type="number" disabled v-model="form.A03.A030203.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					预收帐款：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030204.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			
			
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					应付账款：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030205.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					长期负债及其他负债：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="form.A03.A030206.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					负债合计：
				</view>
				<view class="active_input">
					<mInput type="number" v-model="fuzhai" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					权益合计：
				</view>
				<view class="active_input">
					<mInput negative disabled type="number" v-model="quanyi" placeholder="" />
				</view>
			</ActiveForm>
			
			<!-- <view class="active_form" style="width: 100%;">
				<view class="active_label">
					表外项目及对资产负债表的其它说明:：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040023.endSum" placeholder="" />
				</view>
			</view> -->
			
		</block>
		
		<block>
			<view class="active_tit">
				<view class="tit">
					财务报表--损益表
				</view> 
			</view>
			<!-- input -->
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月开票营业额：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040024.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月未开票营业额：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040001.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月营业成本（可变成本）：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040002.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月营业费用（固定成本）：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040003.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<!-- <ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					其中：（1）工资支出：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040004.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（2）税收支出：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040005.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（3）买票费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040006.endSum" placeholder="" />
					
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（4）交通费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040007.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（5）租地费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040008.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（6）水电费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040009.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（7）通讯办公：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040010.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（8）招待费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040011.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（9）伙食费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040012.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（10）设备按揭：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040013.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（11）利息费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040014.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（12）其他管理费用：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040015.endSum" placeholder="" />
				</view>
			</ActiveForm> -->
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月净利润：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040016.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月其他支出：
				</view>
				<view class="active_input">
					<mInput negative disabled type="number"  v-model="form.A04.A040017.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			<!-- <ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					其中：（1）家庭开支：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040018.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（2）房贷支出：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040019.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					（3）车贷支出：
				</view>
				<view class="active_input">
					<input type="number" v-model="form.A04.A040020.endSum" placeholder="" />
				</view>
			</ActiveForm> -->
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					近12个月其他收入：
				</view>
				<view class="active_input">
					<mInput negative disabled type="number"  v-model="form.A04.A040021.endSum" placeholder="" />
				</view>
			</ActiveForm>
			<ActiveForm required  ref='' style="width: 50%;">
				<view class="active_label">
					月可支配收入：
				</view>
				<view class="active_input">
					<mInput negative type="number" disabled v-model="form.A04.A040022.endSum" placeholder="" />
				</view>
			</ActiveForm>
			
			
			
		</block>
		
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				zichan:'',
				fuzhai:'',
				quanyi:'',
				form:{
					name:'',
					name2:'',
					endSum:'',
					ndSum:'',
					A03:{
						A030101:{
							beginSum:'',
							endSum:''
						},
						A030102:{
							beginSum:'',
							endSum:''
						},
						A030103:{
							beginSum:'',
							endSum:''
						},
						A030104:{
							beginSum:'',
							endSum:''
						},
						A030105:{
							beginSum:'',
							endSum:''
						},
						A030106:{
							beginSum:'',
							endSum:''
						},
						A030107:{
							beginSum:'',
							endSum:''
						},
						A030108:{
							beginSum:'',
							endSum:''
						},
						A030109:{
							beginSum:'',
							endSum:''
						},
						A030110:{
							beginSum:'',
							endSum:''
						},
						A030201:{
							beginSum:'',
							endSum:''
						},
						A030202:{
							beginSum:'',
							endSum:''
						},
						A030203:{
							beginSum:'',
							endSum:''
						},
						A030204:{
							beginSum:'',
							endSum:''
						},
						A030205:{
							beginSum:'',
							endSum:''
						},
						A030206:{
							beginSum:'',
							endSum:''
						},
					},
					A04:{
						A040001:{
							beginSum:'',
							endSum:''
						},
						A040002:{
							beginSum:'',
							endSum:''
						},
						A040003:{
							beginSum:'',
							endSum:''
						},
						A040004:{
							beginSum:'',
							endSum:''
						},
						A040005:{
							beginSum:'',
							endSum:''
						},
						A040006:{
							beginSum:'',
							endSum:''
						},
						A040007:{
							beginSum:'',
							endSum:''
						},
						A040008:{
							beginSum:'',
							endSum:''
						},
						A040009:{
							beginSum:'',
							endSum:''
						},
						A040010:{
							beginSum:'',
							endSum:''
						},
						A040011:{
							beginSum:'',
							endSum:''
						},
						A040012:{
							beginSum:'',
							endSum:''
						},
						A040013:{
							beginSum:'',
							endSum:''
						},
						A040014:{
							beginSum:'',
							endSum:''
						},
						A040015:{
							beginSum:'',
							endSum:''
						},
						A040016:{
							beginSum:'',
							endSum:''
						},
						A040017:{
							beginSum:'',
							endSum:''
						},
						A040018:{
							beginSum:'',
							endSum:''
						},
						A040019:{
							beginSum:'',
							endSum:''
						},
						A040020:{
							beginSum:'',
							endSum:''
						},
						A040021:{
							beginSum:'',
							endSum:''
						},
						A040022:{
							beginSum:'',
							endSum:''
						},
						A040023:{
							beginSum:'',
							endSum:''
						},
						A040024:{
							beginSum:'',
							endSum:''
						}

					}
				
				}
			}
		},
		props:{
			changeFlag: {
				
			}
		},
		watch:{
			changeFlag:{
				handler:function(res){
				setTimeout(()=>{
					this.sunyi()
				},300)
				setTimeout(()=>{
					this.sunyi()
				},600)
				},
				deep:true
			},
			form:{
				handler:function(res){
					//console.warn('retrench组件数据变化',res)
					getApp().globalData.stdOffsurCommonFinancial = Object.assign(getApp().globalData.stdOffsurCommonFinancial,res) 
				this.zichanHj()
				this.fuzhaiHj()
				this.form.A03.A030105.endSum=Number(this.form.A03.A030106.endSum)+Number(this.form.A03.A030107.endSum)+Number(this.form.A03.A030108.endSum)
				//this.sunyi()
				},
				deep:true
			}
		},
		mounted() {
			//获取返显数据
			setTimeout(()=>{	
				//数据反显
				this.form = getApp().globalData.stdOffsurCommonFinancial
				
				//this.sunyi()
			},getApp().globalData.timeout)
		},
		methods:{
			zichanHj(){
				let num = 0
				let arr=["A030101","A030102","A030103","A030104","A030105","A030109",]
				for(let i=0;i<arr.length;i++){
					num+=Number(this.form.A03[arr[i]].endSum)*100
				}
				this.zichan =num/100
			},
			fuzhaiHj(){
				let num = 0
				let arr=["A030201","A030202","A030203","A030204","A030205","A030206"]
				for(let i=0;i<arr.length;i++){
					num+=Number(this.form.A03[arr[i]].endSum)*100
				}
				this.fuzhai = num/100
				this.quanyi = (this.zichan*100-this.fuzhai*100)/100
			},
			sunyi(){
				
				let industry={}
				if(getApp().globalData.stdOffsurEntBasic.industry==1||getApp().globalData.stdOffsurEntBasic.industry==6){
					 industry = getApp().globalData.stdOffsurWholesale
				}else if(getApp().globalData.stdOffsurEntBasic.industry==2){
					 industry = getApp().globalData.stdOffsurProcuct
				}else if(getApp().globalData.stdOffsurEntBasic.industry==3){
					 industry = getApp().globalData.stdOffsurService
				}else if(getApp().globalData.stdOffsurEntBasic.industry==4){
					 industry = getApp().globalData.stdOffsurTraffic
				}else if(getApp().globalData.stdOffsurEntBasic.industry==5){
					 industry = getApp().globalData.stdOffsurConstruction
					 industry.invoiceRatio = 100
				}
				if(getApp().globalData.stdOffsurEntBasic.industry==5){
					//console.log(getApp().globalData.stdOffsurConstructionMargin)
					this.form.A04.A040024.endSum =(Number(getApp().globalData.stdOffsurConstructionMargin[0].invoice12month)*100+Number(getApp().globalData.stdOffsurConstructionMargin[1].invoice12month)*100)/100  
				    this.form.A04.A040001.endSum = (Number(industry.turnover12month)*100 - this.form.A04.A040024.endSum*100)/100
				}else{
					//近12个月月均开票营业额 = 近12月营业额/工程额*开票比例
					this.form.A04.A040024.endSum = Number(industry.turnover12month)*Number(industry.invoiceRatio)/100
				    //近12个月月均未开票营业额 = 近12月营业额*（1-开票比例）
				    
				    this.form.A04.A040001.endSum = Number(industry.turnover12month)*(1-(Number(industry.invoiceRatio)/100))
				}
				
				
				
				
				//近12个月月均营业成本（可变成本）=近12月营业额*（1-综合毛利率）
				this.form.A04.A040002.endSum =  Number(industry.turnover12month)*(1-(Number(industry.marginRate))/100) 
				//近12个月营业费用（固定成本）=除其他以外费用合计
				this.form.A04.A040003.endSum = 0
				let fyArr = getApp().globalData.stdOffsurLoanCost
				
				for(let i=0;i<fyArr.length;i++){
					this.form.A04.A040003.endSum += Number(fyArr[i].cost12months)
				}
				//近12个月净利润 = 近12月营业额-可变成本-固定成本
				this.form.A04.A040016.endSum = (Number(industry.turnover12month)*100 - Number(this.form.A04.A040002.endSum)*100-Number(this.form.A04.A040003.endSum)*100)/100
				//近12个月其他收入 =  
				//this.form.A04.A040021.endSum = getApp().globalData.stdOffsurLoanBasic.outIncome
				//月可支配收入 = 净利润-其他支出+其他收入 
				this.form.A04.A040022.endSum = ((Number(this.form.A04.A040016.endSum)-Number(this.form.A04.A040017.endSum)+Number(this.form.A04.A040021.endSum))/12).toFixed(2)
				//近12个月其他支出=费用_其他
				//this.form.A04.A040017.endSum =Number(getApp().globalData.stdOffsurLoanBasic.otherOutInvestment) 
			}
		}
	}
</script>

<style>
</style>
